const {Configuration} = require("webpack")

const HtmlWebpackPlugin = require("html-webpack-plugin")

const {CleanWebpackPlugin} = require("clean-webpack-plugin")
const path = require("path")

/**
 * @type {Configuration}
 */
const config = {
    entry: {
        home: "/src/home.js",
        about: "/src/about.js"
    },
    output: {
        path: path.resolve(__dirname, "./dist"),
        filename: "[name].bundle.js"
    },
    plugins: [
        new CleanWebpackPlugin(),
        new HtmlWebpackPlugin({
            template: "./home.html",
            filename: "home.html",
            chunks: ["home"]
        }),
        new HtmlWebpackPlugin({
            template: "./about.html",
            filename: "about.html",
            chunks: ["about"]
        }),

    ],
    optimization: {
        splitChunks: {
            chunks: "all",
            minSize: 0
        }
    },

    mode: "none"
}

module.exports = config